import request from '@/utils/request'

// 商品SPU列表
export function querySpuList(data) {
  return request({
    url: '/v1/goods/spu/list',
    method: 'POST',
    data
  })
}

// 商品SkU列表
export function querySkuList(data) {
  return request({
    url: '/v1/goods/sku/list',
    method: 'POST',
    data
  })
}

// 创建组合sku
export function createCombinationSku(data) {
  return request({
    url: '/v1/goods/combination-sku/create',
    method: 'POST',
    data
  })
}

// 查询条件列表
export function queryConditionList(data) {
  return request({
    url: '/v1/goods/condition/list',
    method: 'POST',
    data
  })
}

// 保存条件列表
export function conditionSave(data) {
  return request({
    url: '/v1/goods/condition/save',
    method: 'POST',
    data
  })
}

// 删除查询条件
export function conditionDelete(data) {
  return request({
    url: '/v1/goods/condition/delete',
    method: 'POST',
    data
  })
}

// 批量证书导入
export function certificateImport(data) {
  return request({
    url: '/v1/goods/certificate/import',
    method: 'POST',
    data
  })
}

// 恢复SPU商品
export function spuRecover(data) {
  return request({
    url: '/v1/goods/spu/recover',
    method: 'POST',
    data
  })
}

// 商品日志
export function queryLogList(data) {
  return request({
    url: '/v1/goods/log/list',
    method: 'POST',
    data
  })
}

// 组合sku审核
export function skuReview(data) {
  return request({
    url: '/v1/goods/sku/review',
    method: 'POST',
    data
  })
}

// 删除商品到回收池
export function spuDelete(data) {
  return request({
    url: '/v1/goods/spu/recycle',
    method: 'POST',
    data
  })
}

// 删除商品到回收池
export function skuRecycle(data) {
  return request({
    url: '/v1/goods/sku/recycle',
    method: 'POST',
    data
  })
}


// 商品证书列表
export function getCertificateList(data) {
  return request({
    url: '/v1/goods/certificate/list',
    method: 'POST',
    data
  })
}

// 合并spu
export function mergeSPU(data) {
  return request({
    url: '/v1/goods/spu/merge-spu',
    method: 'POST',
    data
  })
}

// 选择组合sku列表
export function queryCombinationSkuList(data) {
  return request({
    url: '/v1/goods/combination-sku/select-sku-list',
    method: 'POST',
    data
  })
}
//获取库存成本
export function getCostPrice(params) {
  return request({
    url: '/v1/goods/warehouse/stock',
    method: 'GET',
    params
  })
}

// 供应商列表
export function getSupplierList(data) {
  return request({
    baseURL: window.APP_GETEWAY.pms,
    url: '/v1/base/supplier',
    method: 'post',
    data
  })
}

// 通过子sku获取关联的组合sku
export function getSKUCombinationRelation(data) {
  return request({
    url: '/v1/goods/combination-sku/sku-combination-relation',
    method: 'POST',
    data
  })
}

// 恢复SKU商品
export function skuRecover(data) {
  return request({
    url: '/v1/goods/sku/recover',
    method: 'POST',
    data
  })
}